package com.punch.common.enums.course;


/**
 * 星期枚举
 */
public enum WeekEnum {
    MONDAY(1, "星期一", "一"),
    TUESDAY(2, "星期二", "二"),
    WEDNESDAY(3, "星期三", "三"),
    THURSDAY(4, "星期四", "四"),
    FRIDAY(5, "星期五", "五"),
    SATURDAY(6, "星期六", "六"),
    SUNDAY(7, "星期日", "日"),
    ;

    WeekEnum(int code, String name, String simpleName) {
        this.code = code;
        this.name = name;
        this.simpleName=simpleName;
    }


    private int code;
    private String name;
    private String simpleName;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSimpleName() {
        return simpleName;
    }

    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }


    public static String getName(Integer code) {
        if (code == null) {
            return "";
        }
        for (WeekEnum roleEnum : WeekEnum.values()) {
            if (roleEnum.getCode() == code) {
                return roleEnum.getName();
            }
        }
        return "";
    }


    public static String getSimple(Integer code) {
        if (code == null) {
            return "";
        }
        for (WeekEnum roleEnum : WeekEnum.values()) {
            if (roleEnum.getCode() == code) {
                return roleEnum.getSimpleName();
            }
        }
        return "";
    }


}

